package com.qiyee.dalligent.module.base;

import lombok.Data;

@Data
public class BaseResponse<T> {
    private Integer code;
    private T body;
    private String message;


    public static BaseResponse success(Object body){
        BaseResponse build = new BaseResponse();
        build.setCode(0);
        build.setMessage("success");
        build.setBody(body);
        return build;
    }
    public static BaseResponse error(Object body){
        BaseResponse build = new BaseResponse();
        build.setCode(1);
        build.setMessage("error");
        build.setBody(body);
        return build;
    }
}
